package com.cloud.base.designmode.chain;

public class FactoryApplication {
    public static void main(String[] args) {
        FactoryApplication.getGatewayHandler().doService();
    }
    /**
     * 设置下一个getGatewayHandler
     * @return
     */
    public static GatewayHandler getGatewayHandler() {
        BlacklistHandler blacklistHandler = new BlacklistHandler();
        blacklistHandler.setNextGatewayHandler(new ConversationHandler());
        CurrentLimitHandler currentLimitHandler = new CurrentLimitHandler();
        currentLimitHandler.setNextGatewayHandler(blacklistHandler);
        return currentLimitHandler;
    }

    // 使用策略模式  获取实现GatewayHandler的是是实现类
    // 再根据type值来生成getGatewayHandler顺序，使用springbean的方式
}